$(document).ready(function (){
    var table = $('#relationTable').DataTable({
        "paging": true,
        "pageLength": 10,
        "searching": true,
        "order": [[3, "dsc"]],
        "columnDefs": [
            {
                "targets": [0],
                "className": "custom-row"
            }
        ],
        "rowCallback": function (row, data) {
            if (data[3] > 2) {
                $(row).addClass('highlight-row');
            }

            $(row).on('click',function () {
                var center = table.row(row).data()[0];
                table.clear().draw();
                displayDetails(center);
            });
        },
        "language": {
            "lengthMenu": "显示 _MENU_ 行数据",
            "search": "搜索:",
            "info": "显示第 _START_ 到 _END_ 条数据，共 _TOTAL_ 条",
            "paginate": {
                "first": "首页",
                "last": "尾页",
                "next": "下一页",
                "previous": "上一页"
            }
        }
    });

});

